<?php
    session_start();
    include('top.php');
    include('../sql.php');
    $students = "select * from user";
    $students_result = $link->query($students);
?>
<div class="home-container-body">
    <?php include('nav.php'); ?>
</div>

<div class="admin_hone-content">
    <table width="100%">
        <tr>
            <th>序号</th>
            <th width="200">考生信息</th>
            <th>查看资料</th>
            <th>状态</th>
            <th>成绩登记</th>
        </tr>
    <?php while($students_row = mysqli_fetch_array($students_result)) { ?>
        <tr>
            <td>
                <?php echo "考生序号：". $students_row['id']; ?>
            </td>
            <td>
                <?php echo "姓名：" . $students_row['name']; ?>
            </td>
            <td><a href="detail.php?id=<?php echo $students_row['id']; ?>" target="_blank">查看考生详细资料</a></td>
            <td>
                <?php if (empty($students_row['first'])) { ?>
                <span style="color: #f7972a;">资格尚未审查</span>
                <?php } else { if ($students_row['first'] > 60) { ?>
                <span style="color: #6dbc37;">资格审查通过</span>
                <?php } else { ?>
                <span style="color: #dd4b4d;">资格审未通过</span>
                <?php } } ?>
            </td>
            <td>
                <form method="post" action="control.php?action=second&id=<?php echo $students_row['id']; ?>">
                    <input type="text" name="second" value="<?php echo $students_row['second']; ?>">
                    <input type="submit" value="登记">
                </form>
            </td>
        </tr>
        <?php } ?>
    </table>
</div>
<?php include('bottom.php'); ?>